/*
* Position.java
* Purpose:   Organism's position in the simulation's environment
* Author:    pattersa
* Date:      $(date)
*/
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package protovitae.data;

/**
 *
 * @author pattersa
 */
public class Position {

    private double x;
    private double y;
    private double z;
    
    public Position(double x, double y, double z){
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    public double getZ() {
        return z;
    }

    public void setZ(double z) {
        this.z = z;
    }
    
    public String toString(){
        return ""+x+","+y+","+z;
    }
    
    /**
     * Distance between two points on the xy plane
     * @param pos
     * @return
     */
    public double getXYDistance(Position pos){
        return Math.sqrt(Math.pow(this.x-pos.x, 2)+Math.pow(this.y-pos.y, 2));
    }
}
